package com.example.testone.adapter

import android.graphics.drawable.Drawable
import android.widget.ImageView
import androidx.databinding.BindingAdapter

class MyBindingAdapter {
    companion object{
        @JvmStatic
        @BindingAdapter(value = ["imageUrl", "placeholder","srcCompat"], requireAll = false)
        fun setImageUrl(imageView: ImageView, url: String?, placeHolder: Drawable?, srcCompat: Drawable?) {
            if (placeHolder != null) {
                imageView.setImageDrawable(placeHolder);
            }else if(srcCompat != null){
                imageView.setImageDrawable(srcCompat);
            } else{

            }
        }
    }

}